/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import { CustomRequestOptions_ } from '@/http/types';

import * as API from './types';

/** 获取已读用户id 获取消息已读用户列表 GET /message/group/findReadedUsers */
export function messageGroupFindReadedUsersUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessageGroupFindReadedUsersUsingGetParams;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultListLong>('/message/group/findReadedUsers', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询聊天记录 查询聊天记录 GET /message/group/history */
export function messageGroupHistoryUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessageGroupHistoryUsingGetParams;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultListGroupMessageVO>('/message/group/history', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 拉取离线消息 拉取离线消息,消息将通过webscoket异步推送 GET /message/group/pullOfflineMessage */
export function messageGroupPullOfflineMessageUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessageGroupPullOfflineMessageUsingGetParams;
  options?: CustomRequestOptions_;
}) {
  return request<API.Result>('/message/group/pullOfflineMessage', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 消息已读 将群聊中的消息状态置为已读 PUT /message/group/readed */
export function messageGroupReadedUsingPut({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessageGroupReadedUsingPutParams;
  options?: CustomRequestOptions_;
}) {
  return request<API.Result>('/message/group/readed', {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 撤回消息 撤回群聊消息 DELETE /message/group/recall/${param0} */
export function messageGroupRecallIdUsingDelete({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessageGroupRecallIdUsingDeleteParams;
  options?: CustomRequestOptions_;
}) {
  const { id: param0, ...queryParams } = params;

  return request<API.ResultGroupMessageVO>(`/message/group/recall/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 发送群聊消息 发送群聊消息 POST /message/group/send */
export function messageGroupSendUsingPost({
  body,
  options,
}: {
  body: API.GroupMessageDTO;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultGroupMessageVO>('/message/group/send', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
